UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RjfdvGf/V+pDRUYrnsQhjK1waYb7854Vr2VcFtKkkQ0='
WHERE
key_id = '02cda0f807ff32ddbba6481f7c65eb6507220cb297353346cc35900f33c57c01'
AND (
token = 'RjfdvGf/V+pDRUYrnsQhjK1waYb7854Vr2VcFtKkkQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)