UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/hzmV1GXgvnUab6TsjEsem+AH9HvF4xewlv7WuFenkc='
WHERE
key_id = 'df10975c4ad63e8572594b9d6b96f851316537551154553054a18f07f83b874f'
AND (
token = '/hzmV1GXgvnUab6TsjEsem+AH9HvF4xewlv7WuFenkc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)