UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '37yQ7IkyXNx2rSmEABGwzIEeimtCrF3QtZMUZh2RZOw=' 
WHERE 
  key_id = '7d2d57bb683976de314ddf1dd75f8d8fe1ef70b14f37ff5b22e4684e0aed75eb' 
  AND (
    token = '37yQ7IkyXNx2rSmEABGwzIEeimtCrF3QtZMUZh2RZOw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030