UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'unI666RaduSg/N7Im02cUoxbJo7q2V62cBtZCsR4u4Q='
WHERE
key_id = 'ff1ebe753edc877fcfb6da15b7d39f5c8fe4a58efb2cf3380a5c3329c5a1fedf'
AND (
token = 'unI666RaduSg/N7Im02cUoxbJo7q2V62cBtZCsR4u4Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)