UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nXWMmMYJZ0qoZFLKohBUoueaJYKBCk0kNaAGCBwHoLg='
WHERE
key_id = '41c52f09868829bb4cbe6b94658ecb4da3d8ba212283d750b8cc687212bf13cb'
AND (
token = 'nXWMmMYJZ0qoZFLKohBUoueaJYKBCk0kNaAGCBwHoLg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)