UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Sri5XbWn+TE1wxJCiBqAygv3w637pJakcqoCPMP5+vU='
WHERE
key_id = '98ecf44f01622c829aed72b7d52906bf81bcbe93521b40e6ecd5199c402c5a83'
AND (
token = 'Sri5XbWn+TE1wxJCiBqAygv3w637pJakcqoCPMP5+vU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)