UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AMx7cSZKnthItQM5H3goqlmvfIfwt0w8Q40/P+HpAMQ='
WHERE
key_id = 'eea58b49140bd923de0789c392bef79f114fdc9cff4390a424f29cfcbd919708'
AND (
token = 'AMx7cSZKnthItQM5H3goqlmvfIfwt0w8Q40/P+HpAMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)