UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v3SeJZcyzxtHwKAYFOWu4QZSNP0pM6iLuaF8Su0JHho='
WHERE
key_id = '487d35a0a26ec3ac3ceb9d5f6747f67caf6d015f8bfc479c6009d4c9bbed97e7'
AND (
token = 'v3SeJZcyzxtHwKAYFOWu4QZSNP0pM6iLuaF8Su0JHho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)