UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4/gf/D4xzK75bcIwa72BZEKLPu1mj9J7037Naa/LDik='
WHERE
key_id = '63b4bc3e5639bfb3009f427745ae8f76e7780477114da652778ba59008425326'
AND (
token = '4/gf/D4xzK75bcIwa72BZEKLPu1mj9J7037Naa/LDik='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)