UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sgoORS+lQ+GVWsilLMfIHwlknWQrt4+EEKI0RZySb1M='
WHERE
key_id = 'eef9e4889bad24e56f2ba2fea9d631c428ba75af6d6a080cce841198678731dd'
AND (
token = 'sgoORS+lQ+GVWsilLMfIHwlknWQrt4+EEKI0RZySb1M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)