UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4UAanK6v+ivgy9n1ofHkEI9yosOtArFmwS5PQTWqMAA='
WHERE
key_id = '2b92007a9b4069f5f2f2499b21e152f75749b6991693e34bba9a2dadd5a9d604'
AND (
token = '4UAanK6v+ivgy9n1ofHkEI9yosOtArFmwS5PQTWqMAA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)