UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XmTdq3UNLpwoXhoq4LWmQMuzp4+6oQqb2LRmE6k/Knw='
WHERE
key_id = '0df1cd155f4c369cae1ff90a0ba1d5658a3bf188f56e2ec3f4c90841fa82b1c8'
AND (
token = 'XmTdq3UNLpwoXhoq4LWmQMuzp4+6oQqb2LRmE6k/Knw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)