UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dRfuOq3raYJuvU8KhmMMN5he7br40iJYahSogdy01YY='
WHERE
key_id = '80233d44c8a8112f3ba975b1e9bc95def89c1fe11eb58df680507d34c97e211c'
AND (
token = 'dRfuOq3raYJuvU8KhmMMN5he7br40iJYahSogdy01YY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)