UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HSrHeAQNt3/rJGl9krj78rN9VDjSjBnM90ySUWePlx4=' 
WHERE 
  key_id = '869b48a51b7afc13ac96c6ddbaf12d0c63a4e6a25299a1d98147ebbb53354e23' 
  AND (
    token = 'HSrHeAQNt3/rJGl9krj78rN9VDjSjBnM90ySUWePlx4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031