UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ODMYbH1YH8UWyh2YIow+7bjo4cYDxn16eZxyfC4cx5E='
WHERE
key_id = 'df6098f1ee71bb024f52d2e87dee4dd923855b29fce8ddb0561b306de368f6c1'
AND (
token = 'ODMYbH1YH8UWyh2YIow+7bjo4cYDxn16eZxyfC4cx5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)