UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xiBGyyHNaPOmQaiEa9crDbJsoTmQ28DvemknE/f2ceU='
WHERE
key_id = 'be1d887f6eb18b44950f4fd8a6e3712b352de96b188dd0e42273961aa74c9daf'
AND (
token = 'xiBGyyHNaPOmQaiEa9crDbJsoTmQ28DvemknE/f2ceU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)