UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cLWVsT8o5t4c6vg5NhVS1eli+tqyowE7LUM1h2b+2no='
WHERE
key_id = 'b2ed878236c7b644f4f1b04e8735d9b59aebda3dc7e39af8fd6c622bb16d6ebe'
AND (
token = 'cLWVsT8o5t4c6vg5NhVS1eli+tqyowE7LUM1h2b+2no='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)