UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wVOPgXGEN/BZJnz+onTX003LVU3pLdvlMlXUsI8rVVc=' 
WHERE 
  key_id = '2dbb9bb776cf3f396cee6f8e7a1adb66c19e2bf9cd0fdec520c42be3362b1bae' 
  AND (
    token = 'wVOPgXGEN/BZJnz+onTX003LVU3pLdvlMlXUsI8rVVc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047