UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mJGn/IPeqMuomT97+8zjQ4nMbO8AJegSh4/AoLABj8A='
WHERE
key_id = 'ee739e0709ed61432f05dd3604afd4eda9cceb88fddde5a41bcbd1733069564e'
AND (
token = 'mJGn/IPeqMuomT97+8zjQ4nMbO8AJegSh4/AoLABj8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)