UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7V8RVHLuSU7HxhOBqp2lKTI49S9az6+DBmKzAzYFZNA=' 
WHERE 
  key_id = 'b4b7c6d598ce50714dc51141af407ff9ddd40b09a0a770de43d075f6af875a14' 
  AND (
    token = '7V8RVHLuSU7HxhOBqp2lKTI49S9az6+DBmKzAzYFZNA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040