UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PLSBdLU46d631Hx85fc7IKJfQ6R5WRowkaj1vJQDyx4=' 
WHERE 
  key_id = 'a6f18c21d5f36593e56c610de01eebe75738a8a50d4f3c1ca7c2b6d669ccd690' 
  AND (
    token = 'PLSBdLU46d631Hx85fc7IKJfQ6R5WRowkaj1vJQDyx4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041