UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/1sdDU/FJCz2rnDrERjvKQ+rfG2C9CDmGpiLuynKffM='
WHERE
key_id = 'ad64daa58af581648d988e60c71dc045d496fd5d884287fd9fd9a048a5c69606'
AND (
token = '/1sdDU/FJCz2rnDrERjvKQ+rfG2C9CDmGpiLuynKffM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)