UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MUHg99acoyfJAW0jxFLs6epHPQ60qSi+jkSDvhMSKRI='
WHERE
key_id = '586cf49f30b3bf5734dc2ff0d5b520a630c69ab3b04a44b9cb9e871398c65f56'
AND (
token = 'MUHg99acoyfJAW0jxFLs6epHPQ60qSi+jkSDvhMSKRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)