UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hjfZJjv2uhfg85T1tsLgCYPHhWzrggmjrHtOl+ZCX38='
WHERE
key_id = '37cca83f59cb4856f474395e3e0be9004dda456a3d9765656199d929ddb53e6c'
AND (
token = 'hjfZJjv2uhfg85T1tsLgCYPHhWzrggmjrHtOl+ZCX38='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)