UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IKzK7dDf4n3tLpXvhVAGvsMKE1I+eikJRHY4UNcmsiU=' 
WHERE 
  key_id = 'e14e4ce40eceaa8f148cff2692d0f6c2f4eb7a5506c8fa5917fd5ffb0009e154' 
  AND (
    token = 'IKzK7dDf4n3tLpXvhVAGvsMKE1I+eikJRHY4UNcmsiU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045