UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IRUbamiNTUcKepqVkPKMH8Cu3+F2QNenZ9UFrkyIIis='
WHERE
key_id = 'a72010234cdfe5d3f69c966401555995bc5c4c642162388be1731246c14fc24b'
AND (
token = 'IRUbamiNTUcKepqVkPKMH8Cu3+F2QNenZ9UFrkyIIis='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)