UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '047hSPihjeKT6Zv/m7VmATqy53UUpmsDJwMf93qBAng='
WHERE
key_id = 'cd7d62bdaae611fb76bf99ef83e447b3a95349eaff20a4a0c5a3e4e810386d4c'
AND (
token = '047hSPihjeKT6Zv/m7VmATqy53UUpmsDJwMf93qBAng='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)