UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '71zdCY+zNOi70aiMqj3WXZGO710zXr2b2/EJ1tOIP94=' 
WHERE 
  key_id = 'd85d40ef0f4bb0a3b8777c2da341a8a51350db50dfdcc3bd2439517b1b8a8654' 
  AND (
    token = '71zdCY+zNOi70aiMqj3WXZGO710zXr2b2/EJ1tOIP94=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020