UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+UbQe1Fj5hY1ei79VblZttvnxLZFTghmq05POSvG2HM='
WHERE
key_id = 'a127502e8427529ed39e014d487fe480ad6b0eaac95e773edb9f12567c5b621c'
AND (
token = '+UbQe1Fj5hY1ei79VblZttvnxLZFTghmq05POSvG2HM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)