UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nltj7VRzoM0+AEbKn2H7MbM+ZLAY/PwQ4OrwS2BvLQI=' 
WHERE 
  key_id = 'a7e764eaaeef0fbfd67d8bd06546dff07060f2f61e358d67af0b533394694b11' 
  AND (
    token = 'Nltj7VRzoM0+AEbKn2H7MbM+ZLAY/PwQ4OrwS2BvLQI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00141