UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6Bc8pGLFG1J2LUNeMvRM4pEQNZkUHJOlgSoMHwEFblw=' 
WHERE 
  key_id = '96085414813a597b4f39192c9d9487d577929cce303a4f9c2ada00270ca701a7' 
  AND (
    token = '6Bc8pGLFG1J2LUNeMvRM4pEQNZkUHJOlgSoMHwEFblw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031