UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ICnLOZtTDwOI3FSg/lUM+/ilFbEABx9Ug3ln9PyZRaU='
WHERE
key_id = 'a5a4b3db335ef11f72589826f168a4a73325187ab230bf5460f499ed4938d22f'
AND (
token = 'ICnLOZtTDwOI3FSg/lUM+/ilFbEABx9Ug3ln9PyZRaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)