UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L0Pd73b1uMZGbpLg0KzJAi+guVGoTs1VaZEJaOt0fZs='
WHERE
key_id = 'b3e634fe2889183756d04890b5cfd9be8b863ebb6d7ae26e836dda4c8a6915d8'
AND (
token = 'L0Pd73b1uMZGbpLg0KzJAi+guVGoTs1VaZEJaOt0fZs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)